import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Qwe from '../views/Qwe.vue'
import Ranking from '../views/Ranking.vue'
import RankingInfo from '../views/RankingInfo.vue'
import Recommend from '../views/Recommend.vue'
import Song from '../views/Song.vue'
import Radio from '../views/Radio.vue'
import RadioIndex from '../views/RadioIndex.vue'
import RadioRankin from '../views/RadioRankin.vue'
import Singer from '../views/Singer.vue'
import SingerList from '../views/SingerList.vue'
import SingerInfo from '../views/SingerInfo.vue'
import SingerInfoA from '../views/SingerInfo/SingerInfoA.vue'
import SingerInfoB from '../views/SingerInfo/SingerInfoB.vue'
import SingerInfoC from '../views/SingerInfo/SingerInfoC.vue'
import SingerInfoD from '../views/SingerInfo/SingerInfoD.vue'
import Newsong from '../views/Newsong.vue'
import SongList from '../views/SongList.vue'
import Songinfo from '../views/Songinfo.vue'
import Search from '../views/Search.vue'
import SearchA from '../views/search/SearchA.vue'
import SearchB from '../views/search/SearchB.vue'
import SearchC from '../views/search/SearchC.vue'
import SearchD from '../views/search/SearchD.vue'
import SearchE from '../views/search/SearchE.vue'
import SearchF from '../views/search/SearchF.vue'
import SearchG from '../views/search/SearchG.vue'
import SearchH from '../views/search/SearchH.vue'
import SearchNum from '../views/search/SearchNum.vue'
import AlbumInfo from '../views/AlbumInfo.vue'
import VideoInfo from '../views/VideoInfo.vue'
import MVInfo from '../views/MVInfo.vue'
Vue.use(VueRouter)

const originalPush = VueRouter.prototype.push

VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
const routes = [{
        path: '/',
        name: 'Qwe',
        component: Index,
        children: [{
                path: '/',
                name: 'Qwe',
                component: Qwe,
                children: [
                    { path: '/', name: 'Recommend', component: Recommend },
                    { path: '/recommend', name: 'Recommend', component: Recommend },
                    { path: 'ranking', name: 'Ranking', component: Ranking, children: [{ path: '/', name: 'Ranking', component: RankingInfo }, { path: ':id', name: 'Ranking', component: RankingInfo, }, ], },
                    { path: 'song', name: 'Song', component: Song, },
                    {
                        path: 'radio',
                        name: 'Radio',
                        component: Radio,
                        children: [{
                                path: '/',
                                name: 'Radio',
                                component: RadioIndex,
                            },
                            {
                                path: ':id',
                                name: 'Radio',
                                component: RadioRankin,
                            }
                        ]
                    },
                    {
                        path: 'singer',
                        name: 'Singer',
                        component: Singer,
                        children: [{ path: '/', name: 'Singer', component: SingerList, },
                            { path: ':area/:type', name: 'Singer', component: SingerList, },
                        ]
                    },
                    { path: 'newsong', name: 'Newsong', component: Newsong },
                    { path: 'songlist/:id', component: SongList },
                    { path: 'songinfo/:id', component: Songinfo },
                    { path: 'albuminfo/:id', component: AlbumInfo },
                    { path: 'videoInfo/:id', component: VideoInfo },
                    { path: 'mvInfo/:id', component: MVInfo },
                    {
                        path: 'SingerInfo/:id',
                        component: SingerInfo,
                        children: [
                            { path: '/', name: "A", component: SingerInfoA },
                            { path: 'SingerInfoA', name: "A", component: SingerInfoA },
                            { path: 'SingerInfoB', name: "B", component: SingerInfoB },
                            { path: 'SingerInfoC', name: "C", component: SingerInfoC },
                            { path: 'SingerInfoD', name: "D", component: SingerInfoD },
                        ]
                    },

                ]
            },
            {
                path: 'qwe/search',
                component: Search,
                children: [
                    { path: '1/:value', name: '1', components: { default: SearchA, SearchNum: SearchNum } },
                    { path: '100/:value', name: '100', components: { default: SearchB, SearchNum: SearchNum } },
                    { path: '10/:value', name: '10', components: { default: SearchC, SearchNum: SearchNum } },
                    { path: '1014/:value', name: '1014', components: { default: SearchD, SearchNum: SearchNum } },
                    { path: '1000/:value', name: '1000', components: { default: SearchE, SearchNum: SearchNum } },
                    { path: '1006/:value', name: '1006', components: { default: SearchF, SearchNum: SearchNum } },
                    { path: '1009/:value', name: '1009', components: { default: SearchG, SearchNum: SearchNum } },
                    { path: '1002/:value', name: '1002', components: { default: SearchH, SearchNum: SearchNum } },
                ]
            }
        ]
    },



]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router